<?php

class BeginRequest extends CBehavior {
	
	// The attachEventHandler() mathod attaches an event handler to an event.
	// So: onBeginRequest, the handleBeginRequest() method will be called.
	public function attach($owner) {
		$owner->attachEventHandler('onBeginRequest', array($this, 'handleBeginRequest'));
	}

	public function handleBeginRequest($event) {
		
	}
	
	/*
	 * if request no cookie no setting setting language default = 'en'
	 * if have $_POST['lang'] setting $_POST['lang']
	 * if have login user setting Yii::app()->user->getState('lang')
	 * if not login setting cookie
	 */
}